package com.hundsun.documentripper.domain.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * Note：
 *
 * @author ：mengjw
 * @description：历史文件（某一个版本的文件）
 * @date ：Created in 2021/1/26
 */
@Data
@TableName("file_history")
@EqualsAndHashCode(callSuper = true)
public class FileHistory extends File implements Serializable {

    private static final long serialVersionUID = -2374595250631534947L;

    public static FileHistory formFile(File file) {
        FileHistory fileHistory=new FileHistory();
        fileHistory.setUuid(file.getUuid());
        fileHistory.setProductVersionUuid(file.getProductVersionUuid());
        fileHistory.setDocumentUuid(file.getDocumentUuid());
        fileHistory.setDocumentVersion(file.getDocumentVersion());
        fileHistory.setName(file.getName());
        fileHistory.setParentUuid(file.getParentUuid());
        fileHistory.setIsFolder(file.getIsFolder());
        fileHistory.setCreateUser(file.getCreateUser());
        fileHistory.setCreateTime(file.getCreateTime());
        fileHistory.setModifyUser(file.getModifyUser());
        fileHistory.setModifyTime(file.getModifyTime());
        return fileHistory;
    }
}